<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            background: red;
        }
        .box{
            width:200px;
            height: 200px;
            border:1px solid #ccc;
            font-size: 30px;
            text-align:center;
            line-height: 200px;
        }
    </style>
</head>
<body>
    <div id="app">
        <input 
            type="button"
            v-for="(title,index) in arr"
            :value="title"
            :class="{active:num==index}"
            @click="change(index)"
        >
       
        <div class="box"
            v-for="(content,index) in arr"
            v-show="num==index"
        >
            {{content}}
        </div>
       
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                arr:[1,2,3],
                num:0
            },
            methods:{
                change(n){
                    this.num = n;
                }
            }
        })
    </script>
</body>
</html>